home *** CD-ROM | disk | FTP | other *** search
- Path: news.ccs.queensu.ca!news
- From: Wintermute <3mal5@qlink.queensu.ca>
- Newsgroups: comp.windows.x.motif,comp.lang.c++
- Subject: MOTIF Callbacks, C++ Member Functions - SOLVED
- Date: 6 Feb 1996 05:18:22 GMT
- Organization: System Infinity
- Distribution: inet
- Message-ID: <4f6oau$c4m@knot.queensu.ca>
- NNTP-Posting-Host: free1-slip204.tele.queensu.ca
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (Macintosh; I; 68K)
- X-URL: news:comp.windows.x.motif/43382-43481#4f5ojb$ofl@newshound.csrv.uidaho.edu
-
- In case anyone's curious, I have implemented the suggestion I received
- and it works beautifully. The problem was wrapping C++ classes around
- Motif widgets and wanting to use class member functions as callbacks:
- the implicit 'this' parameter of course made this impossible.
-
- The solution was to declare a static member function which is used as a
- callback. Since it is static, there is no 'this' pointer, and it works
- fine. To access the particular class instance, pass the 'this' pointer
- as client data when installing the callback, and it will be available
- when the static member function is called back. (I use it to call
- another member function, but it could be used directly.)
-
- Thanks to all who helped.
-
- --
- Wintermute <3mal5@qlink.queensu.ca> <http://qlink.queensu.ca/~3mal5/>
-
- "If I really knew how to write, I could write something that someone
- could read and it would kill them." - william s. burroughs
-
-
-